<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<input type="hidden" name="organizations/organization[0]/sequence_no" value="1" >
<input type="hidden" name="organizations/organization[0]@submit_org" value="1" >
<input type="hidden" name="organizations/organization[0]/org_code" value="<x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/>" >
<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo1" cellspacing="1" style="table-layout:fixed;">
	<col width="20%;"/>
	<col width="15%;"/>
	<col width="20%;"/>
	<col width="20%;"/>
	<col width="25%;"/>
	<tr> 
		<td   colspan="5" class="t_bar2">项目基本情况</td>
	</tr>
	<tr >
		<td  align="right"><span class="color_red">*</span>项目名称：</td>
		<td colspan="4" >
			<input name="proposal/zh_title" id="zh_title" label="项目名称" type="text"  class="input_text required " style="width: 650px;"   maxlength="30" value="<x:out select="$xmlData/data/proposal/zh_title" />"/>（限30个字）
		</td>
	</tr>
	
	
	
	
	
	
	<tr >
		<td  align="right">主要完成人：</td>
		<td colspan="4">
			  <span name="proposal/main_finish_person" id="main_finish_person"></span>
		</td>
	</tr>
	
	<tr>
		<td  align="right">主要完成单位：</td>
		<td colspan="4">
			 <span name="proposal/main_finish_org" id="main_finish_org"></span>
		</td>
	</tr>
	
	
	
	
	
	
	
	
	
	<tr >
		<td  align="right" style="border-bottom:0px;"><span class="color_red">*</span>推荐单位（或专家）：</td>
		<td  colspan="2" style="border-bottom:0px;">
			<c:set var="recommend_type_value"><x:out select="$xmlData/data/proposal/recommend_type_value" /></c:set>
			<cpt:select id="recommend_type"  key="recommend_type"  value="${recommend_type_value}" onChange="initControlValue(this.id);setRecommend();changeTypeQhh(this.value,true);clearText();"  style="width:150px;"></cpt:select>
			<input type="hidden" id="recommend_type_value" name="proposal/recommend_type_value" class="required" value="${recommend_type_value}" label="推荐单位（或专家）">
			<input type="hidden" name="proposal/recommend_type_name" value="<x:out select="$xmlData/data/proposal/recommend_type_name" />">
		</td>
		<td  align="right" style="border-bottom:0px;"><span class="color_red">*</span>是否国家秘密技术项目：</td>
		<td style="border:0px solid white;border-right:1px solid #B7D1E6;border-bottom:0px;" >
			<cpt:checkbox key="yesorno" name="issecret"   repeatColumn="2" onClick="setRequired();" tagType="radio" width="30px" ></cpt:checkbox>
			<input type="hidden" id="issecret" name="proposal/issecret_value" class="required" label="是否国家秘密技术项目" value="<x:out select="$xmlData/data/proposal/issecret_value" />" >
			<input type="hidden" name="proposal/issecret_name" value="<x:out select="$xmlData/data/proposal/issecret_name" />">
		</td>
	</tr>
</table>
<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo2" cellspacing="1" style="table-layout:fixed;">
	<col width="20%;"/>
	<col width="15%;"/>
	<col width="20%;"/>
	<col width="20%;"/>
	<col width="25%;"/>
	<tr style="display:none;"></tr>
	<tr>
		<td  align="right" ><span class="color_red">*</span>专业评审组：</td>
		<td  colspan="4">
			<c:set var="group_type_value"><x:out select="$xmlData/data/proposal/group_type_value" /></c:set>
			<cpt:select id="group_type"  key="group_type"  value="${group_type_value}" onChange="initControlValue(this.id);" style="width:150px;"></cpt:select>
			<input type="hidden" id="group_type_value" name="proposal/group_type_value" class="required" value="${group_type_value}" label="专业评审组">
			<input type="hidden" name="proposal/group_type_name" value="<x:out select="$xmlData/data/proposal/group_type_name" />">
		<c:set var="template">陕西省科学技术奖专业评审组评审范围.doc</c:set>
		<c:if test="${not empty template}">
					&nbsp;&nbsp;<a href="#" onclick="return ContentDownDesc('${template}');" class="link_x">
					<img alt="" src="${res}/images/ico_word.gif">陕西省科学技术奖专业评审组评审范围</a>&nbsp;&nbsp;
			</c:if>
		
		</td>
		
	</tr>
	<tr >
		<td  align="right"><!-- <span class="color_red">*</span> -->省级成果登记号：</td>
		<td  colspan="2">
			<input name="proposal/reg_no" id="reg_no" label="省级成果登记号" type="text"  class="input_text" style="width: 137px;"   maxlength="12" onfocus="InitInput.setLetterAndNumber(this)" value="<x:out select="$xmlData/data/proposal/reg_no" />"/>
		</td>
		<td  align="right" ><span class="color_red">*</span>类别：</td>
		<td  colspan="1">
			<c:set var="tech_type_value"><x:out select="$xmlData/data/proposal/tech_type_value" /></c:set>
			<cpt:select id="tech_type"  key="tech_type"  value="${tech_type_value}" onChange="initControlValue(this.id);setAppOrgInfoShowHidden();setSummary();clearText();"   style="width:150px" ></cpt:select>
			<input type="hidden" id="tech_type_value" name="proposal/tech_type_value" class="required" value="${tech_type_value}" label="类别">
			<input type="hidden" name="proposal/tech_type_name" value="<x:out select="$xmlData/data/proposal/tech_type_name" />">
		</td>
	</tr>
	<%-- <tr >
		<td  align="right"><span class="color_red"></span>密级、保密期限及批准号：</td>
		<td colspan="4" >
			<input name="proposal/approve_no" id="approve_no" label="密级、保密期限及批准号" type="text"  class="input_text " style="width: 600px;"   maxlength="30" value="<x:out select="$xmlData/data/proposal/approve_no" />"/>（限30个字）
		</td>
	</tr>
	<tr >
		<td  align="right" style="border-bottom:0px;"><span class="color_red">*</span>主题词：</td>
		<td colspan="4" style="border-bottom:0px;">
			<input name="proposal/keyword" id="keyword" label="主题词" type="text"  class="input_text required " style="width: 600px;"   maxlength="60" value="<x:out select="$xmlData/data/proposal/keyword" />"/>（限60个汉字）
		</td>
	</tr> --%>
</table>
<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo3" cellspacing="1" style="table-layout:fixed;">
	<col width="20%;"/>
	<col width="15%;"/>
	<col width="20%;"/>
	<col width="20%;"/>
	<col width="25%;"/>
	<tr style="display:none;"></tr>
	<tr>
		<td align="right" rowspan="3"><span class="color_red">*</span>学科分类名称及代码：</td>
  		 <td  colspan="2">
          	<c:set var="subject1">{'id':'<x:out select="$xmlData/data/proposal/subject_code" />','name':'<x:out select="$xmlData/data/proposal/subject_name" />'}</c:set>
          	<cpt:tree key="medically2" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${subject1}"  label="学科分类名称及代码"
          		id="subject" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue2" />
	        <input id="subject_code" type="hidden" name="proposal/subject_code" class=" " label="学科分类名称及代码" value="<x:out select="$xmlData/data/proposal/subject_code" />"/>
            <input id="subject_name" type="hidden" name="proposal/subject_name"  value="<x:out select="$xmlData/data/proposal/subject_name" />"/>
  	 	 </td>
  	 	 <td align="right" rowspan="3"><span class="color_red">*</span>所属国民经济行业：</td>
       <td  align="left" colspan="2" rowspan="3">
       		<c:set var="belong_industry">{'id':'<x:out select="$xmlData/data/proposal/belong_industry_code" />','name':'<x:out select="$xmlData/data/proposal/belong_industry_name" />'}</c:set>
       	  <cpt:tree key="belong_industry" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${belong_industry}" label="所属国民经济行业"
       		id="belong_industry" name="belong_industry" showPattern="all" shieldPattern="0" onClick="initTreeValueExt2"></cpt:tree>
	        <input type="hidden" name="proposal/belong_industry_code" value="<x:out select="$xmlData/data/proposal/belong_industry_code" />" class="required"  label="所属国民经济行业"/>
	        <input type="hidden" name="proposal/belong_industry_name" value="<x:out select="$xmlData/data/proposal/belong_industry_name" />"/>
      </td>
	</tr>
	<tr >
  		 <td  colspan="2" class="li_2">
          	<c:set var="subject2">{'id':'<x:out select="$xmlData/data/proposal/subject2_code" />','name':'<x:out select="$xmlData/data/proposal/subject2_name" />'}</c:set>
          	<cpt:tree key="medically2" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${subject2}"  label="学科名称"
          		id="subject2" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue2" />
	        <input id="subject2_code" type="hidden" name="proposal/subject2_code" class=" " label="学科名称" value="<x:out select="$xmlData/data/proposal/subject2_code" />"/>
            <input id="subject2_name" type="hidden" name="proposal/subject2_name"  value="<x:out select="$xmlData/data/proposal/subject2_name" />"/>
  	 	 </td>
	</tr>
	<tr>
  		 <td  colspan="2">
          	<c:set var="subject3">{'id':'<x:out select="$xmlData/data/proposal/subject3_code" />','name':'<x:out select="$xmlData/data/proposal/subject3_name" />'}</c:set>
          	<cpt:tree key="medically2" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${subject3}"  label="学科名称"
          		id="subject3" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue2" />
	        <input id="subject3_code" type="hidden" name="proposal/subject3_code" class=" " label="学科名称" value="<x:out select="$xmlData/data/proposal/subject3_code" />"/>
            <input id="subject3_name" type="hidden" name="proposal/subject3_name"  value="<x:out select="$xmlData/data/proposal/subject3_name" />"/>
  	 	 </td>
	</tr>
	<tr>
		<td  align="right"><span class="color_red">*</span>任务来源：</td>
		<td colspan="4">
			<cpt:checkbox key="mission_resource_2016" name="task_resource" repeatColumn="5"   width="30px" ></cpt:checkbox>
			<input type="hidden" id="task_resource" name="proposal/task_resource_value" class="required" label="任务来源" value="<x:out select="$xmlData/data/proposal/task_resource_value" />" >
			<input type="hidden" name="proposal/task_resource_name" value="<x:out select="$xmlData/data/proposal/task_resource_name" />">
		</td>
	</tr>
	
	
	
	<tr>
		<td  align="right">依托平台（限100字）：</td>
		<td colspan="4">
			<textarea rows="3" style="width: 688px;" name='proposal/depend_platform' class="input_textarea maxlength:100"   label="依托平台"><x:out select="$xmlData/data/proposal/depend_platform"/></textarea>
	      <input type='hidden' name='proposal/depend_platform_hidden' id='depend_platform_hidden' value=''>
		</td>
	</tr>
	
	
	
	
	<tr class="li_2">
		<td  align="right">计划、基金名称和编号<br/>（限500字）：</td>
		<td  colspan="4" >
			<textarea rows="6" style="width: 688px;" name='proposal/plan_name' class="input_textarea maxlength:500"   label="计划(基金)名称和编号"><x:out select="$xmlData/data/proposal/plan_name"/></textarea>
	      <input type='hidden' name='proposal/plan_name_hidden' id='plan_name_hidden' value=''>
		</td>
	</tr>
	<tr class="li_2">
		<td  align="right"><span class="color_red">*</span>项目起止时间：</td>
	   <td colspan="2">起始：
		 	<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className=" required date   dateCompare:end_date " label="项目起始时间" ></cpt:date> 
	   </td>
	   <td colspan="2">完成：
	    	<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
			<cpt:date id="end_date" name="proposal/end_date" value="${end_date}" className=" required date" label="项目完成时间" ></cpt:date> 
	   </td>
	</tr>
	<tr>
		<td align="right" colspan="1"><span class="color_red">*</span>推荐单位：</td>
		<td colspan="5">
		<c:set var="recomend_org">
		{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />',
		'name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'
		}					
		</c:set> <cpt:tree id="recomend_org" key="recommended"
				cacheable="false" className="hn_iuput_kuang required selectWidth3"
				readonly="true" value="${recomend_org}" label="推荐单位"
				showPattern="all" shieldPattern="0"
				onClick="initTreeValue2_qhh">
			</cpt:tree> <input type="hidden" name="proposal/recomend_org_value"
			value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" />
			<input type="hidden" name="proposal/recomend_org_name"
			value="<x:out select="$xmlData/data/proposal/recomend_org_name" />" />
		</td>
	</tr>
</table>	

<script type="text/javascript">





$(function(){
	setRecommend();	
	setSummary();
});

function setRecommend(){
	var recommend_type = $("#recommend_type_value").val();
	if(recommend_type == '01'){
		$("#tab10").hide();
		
		/* $("#tab15").show(); */
		
		$("input[name='content/file_code']").val("");
		$("#fileNameHid").parent().parent().hide();
		$("#recomend_org").parent().parent().show();
		$("#recomend_org").addClass("required");
	}else{
		$("#tab10").show();
		
		/* $("#tab15").hide(); */
		
		$("#recomend_org").parent().parent().hide();
		$("input[name='proposal/recomend_org_value']").val("");
		$("input[name='proposal/recomend_org_name']").val("");
		$("#recomend_org").val("");
		$("#recomend_org").removeClass("required");
	}
}


function setSummary(){
	 var text1 = $("#tech_type_value").val();
	  if (text1 == "01"){
		  $("span[id='summary1']").html("技术局限性");
		  $("textarea[id='summary1']").attr("label","技术局限性");
		  $("input[id='summary1']").val("技术局限性");
		  $("a[id='downloadTemplate']").attr("onclick","return ContentDownDesc('主要技术发明.doc');");
		  
		  
		  $("span[id='text10']").text("主要技术发明");
		  
		
		  
	  }else if(text1 == "02" || text1 == "03" || text1 == "04"){
	    $("span[id='summary1']").html("科技局限性");
	    $("textarea[id='summary1']").attr("label","科技局限性");
	    $("input[id='summary1']").val("科技局限性");
	    $("a[id='downloadTemplate']").attr("onclick","return ContentDownDesc('主要科技创新.doc');");
	    
	    
	    $("span[id='text10']").text("主要科技创新");
	    
	  
	    
    }else if(text1 == "05"){
    	$("span[id='summary1']").html("研究局限性");
    	$("textarea[id='summary1']").attr("label","研究局限性");
    	$("input[id='summary1']").val("研究局限性");
    	$("a[id='downloadTemplate']").attr("onclick","return ContentDownDesc('重要科学发现.doc');");
    	
    	
    	$("span[id='text10']").text("重要科学发现");
    	
    	
    
    }else{$("span[id='summary1']").html("技术局限性");
		  $("textarea[id='summary1']").attr("label","技术局限性");
		  $("input[id='summary1']").val("技术局限性");
		  $("a[id='downloadTemplate']").attr("onclick","return ContentDownDesc('主要技术发明.doc');");
		  
		  
		  $("span[id='text10']").text("主要技术发明");
		  
		  
		  }
}



function clearText(){
	
	  $("input[id='file_code']").val("");
	  $("[id='uploadsuccess']").hide();
	  
	  
	  $("textarea[id='summary1']").text("");
	  $("input[id='proposal/goal/summary1_hidden']").val("");
}







	function setParent(id,showFlag){
		var parentTr = $("#" + id).parent();
		  if(parentTr.is('tr')){
			  if(showFlag)
			  	parentTr.show();
			  else
			  	parentTr.hide();
		  }else{
			  if(showFlag)
			  	  parentTr.parent().show();
			  else
				  parentTr.parent().hide();
		  }
	}


$(document).ready(function() {
	setAppOrgInfoShowHidden();
});

function setAppOrgInfoShowHidden(){
	var type = $("#tech_type_value").val();
	if(type=='05'){
		//hidden
			$("#div_app_org_info").hide();
		$("#div_app_org_info_other").show();
		$("#projectQhh").hide();
		
		$("#title11").text("主要论文专著他引情况及科学意义和价值");
		
		
	}else{
		//show
		$("#div_app_org_info").show();
		$("#div_app_org_info_other").hide();
		$("#projectQhh").show();
		
		$("#title11").text("应用情况及效益");
		
	}
}


function initTreeValue2_qhh(treeId, treeNode) {
  	//针对单位性质
  	if (( treeNode && treeNode.isParent)) {
		scmWarn("请选择具体的"+$("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);
		
	
		setInformation(treeNode.id);
	}





	function setInformation(re_org_code){
		
		if(re_org_code !=null){
		 $.ajax({
	         type: "post",
	         url: "${ctx}/proposal/get-reorg-contactinfo",
	         data: {re_org_code:re_org_code},
	         dataType: "json",
	         success: function(data){
	        	            /*   alert(JSON.stringify(data) );
	        	            alert(data.PNAME); */
	        	       if(data.PNAME == null || data.TEL == null || data.EMAIL == null || data.FAX == null){
	        	    	   irisValaddMsg("请联系相应的推荐单位完善单位信息");
	        	       }else{
	        	    	   $("#reco_lixiren").val(data.PNAME);
	                   $("#reco_mobile").val(data.TEL);
	                   $("#reco_email").val(data.EMAIL);
	                   $("#reco_fax").val(data.FAX);
	                   }
	                  }
	     });
		}
	}











//显示全名称路径
function buildName(treeNode, params){
	var str = treeNode.name;
	var obj = treeNode.parentNode;
	while(obj!=null){
		//str =obj.name+"-"+str;
		obj = obj.parentNode;
	}
	return str;
}



function initTreeValueExt2(treeId, treeNode) {

	if (( treeNode && treeNode.level == 0)) {
		scmWarn($("#" + treeId).attr("label")+"不能选择第一级，请选择它的子级！");
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);

}




function initTreeValue2(treeId, treeNode) {
  	//针对单位性质
  	if (( treeNode && treeNode.level == 0)) {
		scmWarn("请选择具体的"+$("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);
		initTreeValue2CallBack();
	}
	
	function setRequired(){
		var isSecret = $("#issecret").val();
		if(isSecret == '01'){
			$("#approve_no").addClass("required");
			$("#approve_no").parent().prev().html("<span class='color_red'>*</span>密级、保密期限及批准号：");
		}
		else{
			$("#approve_no").removeClass("required");
			$("#approve_no").parent().prev().html("密级、保密期限及批准号：");
		}
	}
	
	
	function changeTypeQhh(v_checked_id,v_clear){
		var v_checked=v_checked_id;
		$("#tech_type").find("option[value='01']").remove();
		$("#tech_type").find("option[value='02']").remove();
		$("#tech_type").find("option[value='03']").remove();
		$("#tech_type").find("option[value='04']").remove();
		$("#tech_type").find("option[value='05']").remove();
		if(v_checked=='01'){
			$("#tech_type").append("<option value='01' title='技术发明'>技术发明</option>");
			$("#tech_type").append("<option value='02' title='技术开发'>技术开发</option>");
			$("#tech_type").append("<option value='03' title='技术推广'>技术推广</option>");
			$("#tech_type").append("<option value='04' title='社会公益'>社会公益</option>");
			$("#tech_type").append("<option value='05' title='基础研究'>基础研究</option>");
		}else{
			$("#tech_type").append("<option value='01' title='技术发明'>技术发明</option>");
			$("#tech_type").append("<option value='05' title='基础研究'>基础研究</option>");
		}
		if(v_clear){
			$("#tech_type").find("option[value='']").attr("selected",true);
			$("#tech_type_value").val("");
		}
		
	}
	
</script>

